#include <gtkmm/main.h>
#include <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/image.h>

#include "MainWindow.hpp"

MainWindow::MainWindow() : Gtk::Window()
{
    set_title("MineSweeperEX");
    resize(225, 200);
    set_position(Gtk::WIN_POS_CENTER);

    Gtk::VBox *vbox = manage(new Gtk::VBox());
    add(*vbox);

    Gtk::Image *logo = manage(new Gtk::Image("res/MineSweeperEXLogo.png"));
    vbox->pack_start(*logo);

    Gtk::VButtonBox *buttonBox = manage(new Gtk::VButtonBox(Gtk::BUTTONBOX_CENTER, 10));
    vbox->pack_start(*buttonBox);

    Gtk::Button *button = manage(new Gtk::Button("Create Server"));
    button->set_can_focus(false);
    buttonBox->pack_start(*button);

    button = manage(new Gtk::Button("Join Server"));
    button->set_can_focus(false);
    buttonBox->pack_start(*button);

    button = manage(new Gtk::Button("Quit"));
    button->set_can_focus(false);
    button->signal_clicked().connect(sigc::ptr_fun(&Gtk::Main::quit));
    buttonBox->pack_start(*button);

    show_all();
}
